<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/finance/djlc/cw_djlc_analyze_total_table.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/finance/djlc/cw_djlc_analyze_total_table.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'cw_djlc_analyze_total_id',
                footer: "Foots",
                cnName: '定价差异分析汇总表',
                name: 'djlc/cw_djlc_analyze_total_table',
                url: "/cw_djlc_analyze_total_table/",
                sortName: "cw_djlc_code,analyzeprice"
            });
            const editFormFields = ref({"cw_djlc_djzb_id":"","is_rational":"","reason":"","reasonfileurl":"","caigou_is_rational":"","feedback":"","feedbackurl":""});
            const editFormOptions = ref([[{"dataKey":"是否合理","data":[],"title":"研发确认是否合理","field":"is_rational","type":"select"},
                               {"title":"原因","field":"reason","type":"textarea"},
                               {"title":"原因附件","field":"reasonfileurl","type":"file"}],
                              [{"dataKey":"是否合理","data":[],"title":"采购确认是否合理","field":"caigou_is_rational","type":"select"},
                               {"title":"采购反馈","field":"feedback","type":"textarea"},
                               {"title":"采购反馈附件","field":"feedbackurl","type":"file"}]]);
            const searchFormFields = ref({"groupnum":"","analyzeprice":[null,null]});
            const searchFormOptions = ref([[{"dataKey":"产品定价分组规则","data":[],"title":"组号","field":"groupnum","type":"select"},{"title":"差异","field":"analyzeprice","type":"range"}]]);
            const columns = ref([{field:'cw_djlc_analyze_total_id',title:'差异分析汇总表id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'cw_djlc_djzb_id',title:'定价表id',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'cw_djlc_code',title:'产品定价流程编号',type:'string',width:220,align:'left',sort:true},
                       {field:'groupnum',title:'组号',type:'string',bind:{ key:'产品定价分组规则',data:[]},width:110,align:'left'},
                       {field:'groupnumname',title:'组号名称',type:'string',width:220,align:'left'},
                       {field:'oldprice',title:'对标车型',type:'decimal',width:110,align:'left'},
                       {field:'newprice',title:'需求车型',type:'decimal',width:110,align:'left'},
                       {field:'analyzeprice',title:'差异',type:'decimal',width:110,align:'left'},
                       {field:'is_rational',title:'研发确认是否合理',type:'string',bind:{ key:'是否合理',data:[]},width:220,align:'left'},
                       {field:'reason',title:'原因',type:'string',width:220,align:'left'},
                       {field:'reasonfileurl',title:'原因附件',type:'file',width:220,align:'left'},
                       {field:'caigou_is_rational',title:'采购确认是否合理',type:'string',bind:{ key:'是否合理',data:[]},width:220,align:'left'},
                       {field:'feedback',title:'采购反馈',type:'string',width:220,align:'left'},
                       {field:'feedbackurl',title:'采购反馈附件',type:'file',width:220,align:'left'},
                       {field:'reasonCreator',title:'差异分析确认人',type:'string',width:220,align:'left'},
                       {field:'reasonCreateDate',title:'差异分析确认时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'reasonModifier',title:'差异分析确认修改人',type:'string',width:220,align:'left'},
                       {field:'reasonModifyDate',title:'差异分析确认修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Modifier',title:'修改人',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
